<template>
  <div>
    <TopLogo :value="val"></TopLogo>
    <div class="loginContent">
      <img src="../assets/img/banner.png" alt="">
      <div class="loginBox bodycontent clear">
        <Logincom @sendNum = "getNum"></Logincom>
      </div>
    </div>
  </div>
</template>
<script>
import TopLogo from "@/components/TopLogo.vue";
import Logincom from "@/components/Logincom.vue";
export default {
  created(){
    if(localStorage.login){
      this.$router.push({
          path: '/index/home',
      }) 
    }
  },
  data(){
    return {
      val : "",
      changeNum : this.$store.state.changeNum,
    }
  },
  mounted(){
    if(this.$store.state.changeNum==1){
      this.val =  "会员登录";
    }else if(this.$store.state.changeNum==2){
      this.val =  "会员注册";
    }else if(this.$store.state.changeNum==3){
      this.val =  "找回密码";
    }
  },
  components:{
    TopLogo,
    Logincom,
  },
  methods:{
    getNum(data){
      if(data==1){
        this.val =  "会员登录";
      }else if(data==2){
        this.val =  "会员注册";
      }else if(data==3){
        this.val =  "找回密码";
      }
    }
  },
  watch:{
  }
}
</script>
<style scoped>
  /* 登录页面css样式 */
  .loginContent {
    position: relative;
  }
  .loginContent>img{
    width: 100%;
    height: 500px;
    position: absolute;
    z-index: -1;
  }
  .loginBox{
    float: right;
  }
</style>